<!DOCTYPE html>
<html
  layout:decorator="components/layout"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
>
<head>
  <title>非法信息监测</title>
  <style>
    .deal-panel {
      margin-top: 10px;
    }
  </style>
</head>
<body>
<div
  layout:fragment="content"
  id="app" v-cloak
>
  <!--引入边框角-->
  <div class="container">

    <div class="myHeader">
      <div class="myHeader-title">
        非法信息监测
      </div>

    </div>

    <el-row>
      <el-form label-width="80px">
        <el-col :span="3">
          <el-form-item label-width="0px">
            <el-button
              type="primary"
              size="mini"
              @click="_forward('/illegal-monitor/admin_illegal_file')"
            >文件列表
            </el-button>
          </el-form-item>
        </el-col>

        <el-col :span="3">
          <el-form-item label-width="0px">
            <el-button
              type="primary"
              size="mini"
              @click="_forward('/illegal-monitor/admin_illegal_stat')"
            >网站统计
            </el-button>
          </el-form-item>
        </el-col>

        <el-col :span="3">
          <el-form-item label-width="0px">
            <el-button type="primary" size="mini" icon="el-icon-search" @click="toggle">高级搜索</el-button>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="所在机房:">
            <el-select v-model="form.houseId" @change="searchPage" placeholder="请选择" size="mini" clearable>
              <el-option v-for="house in houses" :label="house.houseName" :key="house.id" :value="house.id">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="危险级别:">
            <el-select v-model="form.dangerLevel" @change="searchPage" placeholder="请选择" size="mini" clearable>
              <el-option v-for="[key,val] in fieldFormatter.moIllegalInfo.dangerLevelMap" :label="val" :key="key"
                         :value="key">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="处置状态:">
            <el-select v-model="form.dealStatus" @change="searchPage" placeholder="请选择" size="mini" clearable><!--          <el-option label="处置状态"></el-option>-->
              <el-option v-for="[key,val] in fieldFormatter.moIllegalInfo.dealStatusMap" :label="val" :key="key"
                         :value="key">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>

        <el-col :span="6">
          <el-form-item label="管理员:">
            <el-select v-model="form.disposer" @change="searchPage" placeholder="请选择" size="mini" clearable>
              <el-option v-for="user in sysUsers" :label="user.loginName" :key="user.id" :value="user.id">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>

    <el-row>
      <el-form label-width="100px" class="container-search" v-show="formShow">
        <el-row :gutter="10">
          <el-col :span="9">
            <el-form-item label="应用IP:">
              <el-input
                v-model="form.ip"
                clearable
                show-word-limit
                maxlength="64"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="3">
            <el-form-item label-width="0">
              <rx-search-action
                v-model="form.ipAction"
              ></rx-search-action>
            </el-form-item>
          </el-col>

          <el-col :span="9">
            <el-form-item label="实际域名:">
              <el-input
                v-model="form.accessDomain"
                clearable
                show-word-limit
                maxlength="30"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="3">
            <el-form-item label-width="0">
              <rx-search-action
                v-model="form.accessDomainAction"
              ></rx-search-action>
            </el-form-item>
          </el-col>

          <el-col :span="9">
            <el-form-item label="访问网址:">
              <el-input
                v-model="form.accessUrl"
                clearable
                show-word-limit
                maxlength="30"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="3">
            <el-form-item label-width="0">
              <rx-search-action
                v-model="form.accessUrlAction"
              ></rx-search-action>
            </el-form-item>
          </el-col>

          <el-col :span="9">
            <el-form-item label="非法信息:">
              <el-input
                v-model="form.illegalInfo"
                clearable
                show-word-limit
                maxlength="30"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="3">
            <el-form-item label-width="0">
              <rx-search-action
                v-model="form.illegalInfoAction"
              ></rx-search-action>
            </el-form-item>
          </el-col>


          <el-col :span="12">
            <el-form-item label="首次采集时间:">
              <rx-range-date
                v-model="form.firstFoundTimeRange"
                @change="arr => changeRangeDate('firstFoundTimeStart', 'firstFoundTimeEnd')(arr)"
              ></rx-range-date>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="处置时间:">
              <rx-range-date
                v-model="form.dealTimeRange"
                @change="arr => changeRangeDate('dealTimeStart', 'dealTimeEnd')(arr)"
              ></rx-range-date>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="危险系数:">
              <el-row :gutter="10">
                <el-col :span="11">
                  <el-select v-model="form.dangerFactorAction" @change="searchPage" placeholder="请选择" clearable>
                    <el-option v-for="[key,val] in fieldFormatter.form.sizeComparison" :label="val" :key="key"
                               :value="key">
                    </el-option>
                  </el-select>
                </el-col>
                <el-col :span="12">
                  <el-input
                    v-model="form.dangerFactor"
                    clearable
                    show-word-limit
                    maxlength="30"
                  ></el-input>
                </el-col>
              </el-row>

            </el-form-item>
          </el-col>

        </el-row>

        <div style="text-align:center; margin-bottom:20px">
          <el-button type="primary" size="medium" @click="searchPage">查 找</el-button>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          <el-button type="primary" size="medium" @click="resetPage">重 置</el-button>
        </div>
      </el-form>
    </el-row>

    <div>
      <my-table
        :data="page.records"
        :columns="columns"
        @table-ref="tableRef"
        @handle-selection-change="selection"
      >
        <template #access_domain="scope">
          <a
            :href="`http://${scope.row.accessDomain}`"
            target="_blank"
          >{{scope.row.accessDomain}}</a>
        </template>
        <template #access_url="scope">
          <a
            :href="scope.row.accessUrl"
            target="_blank"
          >{{scope.row.accessUrl.substring(0,30)+'...'}}</a>
        </template>
      </my-table>
      <div class="pagination">
        <el-pagination
          background
          @size-change="changeSize"
          @current-change="goto"
          :current-page="page.current"
          :page-sizes="[10, 20, 30]"
          :page-size="page.size"
          layout="total, sizes, prev, pager, next, jumper"
          :total="page.total"
        >
        </el-pagination>
        <div class="pagination-tool">
          <el-button
            type="primary"
            size="mini"
            @click="selectAll"
          >全选
          </el-button>
          <el-button
            @click="toggleDealPanelShow"
            type="primary"
            size="mini"
            v-realm="'illegal-monitoring:mo-illegal-info:edit'"
          >批量处置
          </el-button>
          <el-button
            @click="dealCancelSelected"
            type="primary"
            size="mini"
            v-realm="'illegal-monitoring:mo-illegal-info:edit'"
          >取消处置
          </el-button>
          <el-button
            @click="setTrust"
            type="primary"
            size="mini"
            v-realm="'illegal-monitoring:mo-illegal-info:edit'"
          >设置信任
          </el-button>
          <el-button
            @click="exportFile"
            type="primary"
            size="mini"
            v-realm="'illegal-monitoring:mo-illegal-info'"
          >导出
          </el-button>
          <el-button
            @click="deleteSelected"
            type="danger"
            size="mini"
            v-realm="'illegal-monitoring:mo-illegal-info:edit'"
          >删除
          </el-button>
        </div>
      </div>

      <div
        class="container"
        v-show="dealPanelShow"
      >
        <div class="myHeader">
          <div class="myHeader-title">
            非法信息监测
          </div>
        </div>
        <el-form label-width="126px">
          <el-form-item label="处置操作:">
            <rx-radio
              v-model="dealPanelForm.dealStatus"
              :map="fieldFormatter.moIllegalInfoDeal.dealStatusMap"
            ></rx-radio>
          </el-form-item>

          <el-form-item label="日志操作:">
            <rx-radio
              v-model="dealPanelForm.logOperation"
              :map="fieldFormatter.moIllegalInfo.logOperationMap"
            ></rx-radio>
          </el-form-item>

          <el-form-item label="处置备注:">
            <textarea
              id="remark"
              v-model="dealPanelForm.remark"
              cols="50%"
            >
              </textarea>
          </el-form-item>
        </el-form>
        <div>
          <button
            @click="dealSelected"
            class="btn_common"
            v-realm="'illegal-monitoring:mo-illegal-info:edit'"
          >确认
          </button>
          <button
            @click="initDealPanel"
            class="btn_common"
          >重置
          </button>
        </div>
      </div>
    </div>
  </div>
</div>
<div layout:fragment="js">
  <script src="/static/js/module/illegal-monitor/model/MoIllegalInfo.js"></script>
  <script src="/static/js/module/illegal-monitor/api/moIllegalInfoApi.js"></script>
  <script src="/static/js/module/system-config/api/sysUserApi.js"></script>
  <script src="/static/js/module/basic-data/api/baseHouseInfoApi.js"></script>
  <script src="/static/js/module/illegal-monitor/admin_illegal.js"></script>
</div>
</body>
</html>
